home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / comm / cnet / calllog32.lha / Call_Log1 / Call_Logger < prev    next >
Text File  |  1994-06-21  |  13KB  |  229 lines

  1. /**************************************************************************\
  2.              $VER: Call Logger, v3.2 by Dotoran (19-Jun-94)
  3. \**************************************************************************/
  4. options results ; signal on SYNTAX ; signal on ERROR ; signal on IOERR
  5. tr=transmit ; se=sendstring ; gc=getchar ; qu=query
  6. /*************************************************************************\
  7.      SysOp Definable Variables: See the _READ_ME! file for more info!
  8. \*************************************************************************/
  9. V1  = "X"    /* Ignore these Port Numbers.  If X, log all Ports.         */
  10. V2  = "X"    /* Ignore these ID Numbers.    If X, log all ID Numbers.    */
  11. V3  = "X"    /* Ignore these Access Levels. If X, log all Accesses.      */
  12. V4  = 10     /* Max calls to log ever.  Will never exceed this value.    */
  13. V5  = 0      /* Save Call-Backs to the Log? ( 1 = Yes / 0 = No )         */
  14. V6  = 5      /* Log SysOp(ID1) only when (s)he makes this many calls.    */
  15. V7  = 2      /* Activity Flag Backdrop: 1:dots,  2:dashes, 3:lowercase,  */
  16.              /*                         4:stars, 5:sm. x's 6:equals'     */
  17. V8  = "#"    /* 7: Use Ascii character in V8 as filler when V7=7.        */
  18. V9  = 1      /* Allow Log to be Aborted.    ( 1 = Yes / 0 = No )         */
  19. V10 = 1      /* Call_Log Output Type.  ( 0 = Elaborate / 1 = Quick )     */
  20. V11 = 0      /* Call_Log Ordering. ( 0 = Newest 1st / 1 = Oldest 1st )   */
  21. V12 = "db"   /* Quick Log Entry Colors (The MCI code that follows c)    */
  22. V13 = 0      /* Notate Call_Log Ignores?    ( 0 = No / 1 = Yes )         */
  23. D1  = 'GFILES:'                   /* Where the Call_Log is stored.       */
  24. D2  = 'PFILES:Call_Log1/'         /* Where Call_Logger files are stored. */
  25. /*************************************************************************\
  26.       The values of D1 and D2 should both end with either a : or a /
  27. \*************************************************************************/
  28. getuser 23 ; port=result          ;   getuser 1  ; handle=result
  29. getuser 40 ; id=result            ;   getuser 15 ; access=result
  30. getuser 24 ; baud=left(result,2)  ;   total=V4   ; flag=0
  31. if index(v1,port)>0 | index(v2,id)>0 | index(v3,access)>0 then flag=1
  32. if flag=1 & V13=0 then exit
  33. if V10=0 then call DATA0 ; if V10=1 then call DATA1
  34. call READCONFIG ; call COMPUTERS ; call READLOG
  35. if index(lc.2,handle)>0 & V5=0 then flag=1
  36. if id=1 & sysopcalls<V6 then flag=1
  37.     else do ; sysopcalls=0 ; call SAVECONFIG ; end
  38. if flag=1 & V13=0 then exit
  39. getuser 1100465 ; com=comp.result ;   getuser 1400472 ; calls=result
  40. getuser 1400476 ; posts=result    ;   getuser 1400488 ; uploads=result
  41. tr 'Logging your call...'
  42. do i=1 to 9 ; a.i=0 ; end i       ;   file='sysdata:Log/port'||port
  43.  
  44. call open(f1,file,'r')
  45.     do j=1 until eof(f1) ; c.j=readln(f1) ; end j
  46. call close(f1)
  47.  
  48. do i=1 to j
  49.     if index(c.i,'SIGNON')>0   then key1=i
  50.     if index(c.i,'SIGNOFF')>0  then key2=i
  51.     if index(c.i,'NEW USER')>0 then a.9=1
  52. end i ; if a.9=1 then new='*' ; else new=' '
  53.  
  54. s1=substr(c.key1,11,5) ; s2=left(s1,2) ; hr='a' ; if s2>'11' then hr='p'
  55.     if s2>'12' then s2=s2-12 ; if s2='00' then s2='12'
  56.     s1=s2||substr(s1,3)||hr ; signon=right(s1,6)
  57. s1=substr(c.key2,11,5) ; s2=left(s1,2) ; hr='a' ; if s2>'11' then hr='p'
  58.     if s2>'12' then s2=s2-12 ; if s2='00' then s2='12'
  59.     s1=s2||substr(s1,3)||hr ; signoff=right(s1,6) ; key3=key2+1
  60.  
  61. do i=key3 to j
  62.     if index(c.i,'po')>0 then a.1=1 ;   if index(c.i,'re')>0 then a.2=1
  63.     if index(c.i,'uf')>0 then a.3=1 ;   if index(c.i,'df')>0 then a.4=1
  64.     if index(c.i,'pf')>0 then a.5=1 ;   if index(c.i,'gf')>0 then a.6=1
  65.     if index(c.i,'fb')>0 then a.7=1 ;   if index(c.i,'ms')>0 then a.8=1
  66. end i
  67.  
  68. if V10=0 then do
  69.     s1='ceP c9R cfU caD ceG c9T cfF caMcd]' ; s2=''
  70.     if V7=1 then s2='c5. c5. c5. c5. c5. c5. c5. c5.cd]'
  71.     if V7=2 then s2='c5- c5- c5- c5- c5- c5- c5- c5-cd]'
  72.     if V7=3 then s2='c5p c5r c5u c5d c5g c5t c5f c5mcd]'
  73.     if V7=4 then s2='c5* c5* c5* c5* c5* c5* c5* c5*cd]'
  74.     if V7=5 then s2='c5x c5x c5x c5x c5x c5x c5x c5xcd]'
  75.     if V7=6 then s2='c5= c5= c5= c5= c5= c5= c5= c5=cd]'
  76.     if V7=7 then do ; do i=1 to 8 ; s2=s2||'c5'||V8||' ' ; end i
  77.         s2=strip(s2)||'cd]' ; end
  78.     a1='cd['
  79.     do i=1 to 8 ; act=act+a.i
  80.         if a.i=0 then a1=a1||word(s2,i,1)
  81.             else a1=a1||word(s1,i,1)
  82.     end i ; if act=0 then a1='cd[ceNothing!cd]'
  83.     log='z4 z0cfºcb'||right(port,2)||'cc '||center(id,3)||' cf'||new
  84.     log=log||'ca'||left(handle,20)||'c9'||left(baud,3)||a1||' c7'||signon
  85.     log=log||' ce'||signoff||'ca'||right(access,4)||' c9'||com
  86.     log=log||'cd'||right(calls,4)||'cb'||right(uploads,4)||'ce'
  87.     log=log||right(posts,4)||'cfºz4 z0'
  88.     if V13=1 & flag=1 then do
  89.         log='z4 z0cfºcb'||right(port,2)||'cd ----caOccupiedcd---caFor'
  90.         log=log||'cd---caPrivatecd---caUsecd----c7 '||signon||' ce'
  91.         log=log||signoff||' cd-caPortcd-caUnAvailablecd- cfºz4 z0'
  92.         end
  93.     end
  94.  
  95. if V10=1 then do
  96.     s1='P R U D G T F M]' ; s2='' ; a1='['
  97.     if V7=1 then s2='. . . . . . . .]' ; if V7=2 then s2='- - - - - - - -]'
  98.     if V7=3 then s2='p r u d g t f m]' ; if V7=4 then s2='* * * * * * * *]'
  99.     if V7=5 then s2='x x x x x x x x]' ; if V7=6 then s2='= = = = = = = =]'
  100.     if V7=7 then do ; do i=1 to 8 ; s2=s2||V8||' ' ; end i
  101.         s2=strip(s2)||']' ; end
  102.     do i=1 to 8 ; act=act+a.i
  103.         if a.i=0 then a1=a1||word(s2,i,1)
  104.             else a1=a1||word(s1,i,1)
  105.     end i ; if act=0 then a1='[Nothing!]'
  106.     log=' c8ºc'||co||right(port,2)||' '||center(id,3)||' '||new
  107.     log=log||left(handle,20)||left(baud,3)||a1||' '||signon
  108.     log=log||' '||signoff||right(access,4)||' '||com
  109.     log=log||right(calls,4)||right(uploads,4)
  110.     log=log||right(posts,4)||'c8º'
  111.     if V13=1 & flag=1 then do
  112.         log=' c8ºc'||co||right(port,2)||' ----Occupied---For---Private---'
  113.         log=log||'Use---- '||signon||' '||signoff||' -Port-UnAvailab'
  114.         log=log||'le- c8º' ; end
  115.     c=index(V12,co) ; if c=length(V12) then c=1 ; else c=c+1
  116.     co=substr(V12,c,1) ; end
  117.  
  118. call open(f1,d1||'Call_Log','w')
  119.     do i=1 to 6 ; call writeln(f1,top.i) ; end i
  120.     if V11=1 then do ; start=1 ; if logged=total then start=2
  121.         do i=start to logged ; call writeln(f1,lc.i)
  122.         end i ; call writeln(f1,log) ; end
  123.     if V11=0 then do ; end=logged ; if logged=total then end=logged-1
  124.         call writeln(f1,log) ; do i=1 to end ; call writeln(f1,lc.i)
  125.         end i ; end
  126.     do i=1 to 4 ; call writeln(f1,bot.i) ; end i
  127. call close(f1)
  128.  
  129. logged=logged+1 ; if logged>total then logged=total
  130. call SAVECONFIG
  131.  
  132. exit
  133.  
  134. COMPUTERS:
  135.     if exists(d2||'Call_Log_Computers3') then do
  136.         call open(f1,d2||'Call_Log_Computers3','r')
  137.                 do i=0 to ct-1 ; comp.i=readln(f1) ; end i
  138.         call close(f1) ; return ; end
  139.  
  140.     call open(f1,'cnet:bbsmenu','r') ; ct=0
  141.             do until left(j,2)='30' ; j=readln(f1) ; end
  142.             do until r='' ; r=readln(f1) ; r=strip(substr(r,2))
  143.                 comp.ct=left(r,3) ; ct=ct+1 ; end
  144.     call close(f1) ; ct=ct-1 ; call SAVECONFIG
  145.     call open(f1,d2||'Call_Log_Computers3','w')
  146.             do i=0 to ct-1 ; call writeln(f1,comp.i) ; end i
  147.     call close(f1)
  148.   return
  149.  
  150. READLOG:
  151.     if exists(d1||'Call_Log') then do
  152.         call open(f1,d1||'Call_Log','r')
  153.             do i=1 to 6 ; j=readln(f1) ; end
  154.             do i=1 to logged ; lc.i=readln(f1) ; end i
  155.         call close(f1) ; return ; end
  156.     call open(f1,d1||'Call_Log','w')
  157.         do i=1 to 6 ; call writeln(f1,top.i) ; end i
  158.         call writeln(f1,mid.1) ; logged=1
  159.         do i=1 to 4 ; call writeln(f1,bot.i) ; end i
  160.     call close(f1) ; call SAVECONFIG
  161.   signal READLOG
  162.  
  163. READCONFIG:
  164.     if ~exists(d2||'Call_Log_Config') then do ; l=substr(V12,2,1)
  165.         call open(f1,d2||'Call_Log_Config','w')
  166.             call writeln(f1,'0  <--- Total Calls Logged')
  167.             call writeln(f1,'0  <--- Total Computer Types')
  168.             call writeln(f1,'0  <--- Total SysOp Calls')
  169.             call writeln(f1,l||'  <--- Next Quick Log Color')
  170.         call close(f1) ; signal READCONFIG ; end
  171.     call open(f1,d2||'Call_Log_Config','r')
  172.         a=readln(f1) ; logged=word(a,1) ; a=readln(f1) ; ct=word(a,1)
  173.         a=readln(f1) ; sysopcalls=word(a,1) ; a=readln(f1) ; co=word(a,1)
  174.     call close(f1)
  175.     if id=1 then do ; sysopcalls=sysopcalls+1
  176.         call SAVECONFIG ; end
  177.   return
  178.  
  179. SAVECONFIG:
  180.     a1=left(logged,3)||'<-- Total Calls Logged'
  181.     a2=left(ct,3)||'<-- Total Computer Types'
  182.     a3=left(sysopcalls,3)||'<-- Total SysOp Calls'
  183.     a4=left(co,3)||'<-- Next Quick Log Color'
  184.     call open(f1,d2||'Call_Log_Config','w')
  185.         call writeln(f1,a1) ; call writeln(f1,a2)
  186.         call writeln(f1,a3) ; call writeln(f1,a4)
  187.     call close(f1)
  188.   return
  189.  
  190. DATA0:
  191.     act=0 ; ct=0 ; logged=0 ; sysopcalls=0
  192.     if V9=1 then top.1='f1@4CÜÜÕÍ͸ÜÕÍ͸ÜÕ¸ÜÜÜÕ¸ÜÜÜÕÍ͸ÜÕÍ͸ÜÜÜÜÕ¸ÜÜÜÕÍ͸ÜÕÍ͸ÜÜ'
  193.     if V9=0 then top.1='f1a1@4CÜÜÕÍ͸ÜÕÍ͸ÜÕ¸ÜÜÜÕ¸ÜÜÜÕÍ͸ÜÕÍ͸ÜÜÜÜÕ¸ÜÜÜÕÍ͸ÜÕÍ͸ÜÜ'
  194.     top.2='Cß     ³    ÆÍ͵ ³    ³    Æ͵  ÆÍѾ    ³    ³  ³ ³Õ͸     ß'
  195.     top.3='          Ü ßßßßÔÍ;ßÔßß¾ßÔÍ;ßÔÍ;ßÔÍ;ßÔßÔ¾ßßßßÔÍ;ßÔÍ;ßÔÍ;ßßßß Ü          '
  196.     top.4=' ÉÍÍÑÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÑÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÑÍÍÍÍÍÍÍÑÍÍÑÍÍÍÑÍÍÍÑÍÍÍÑÍÍÍ» '
  197.     top.5=" ºP#³ID#³*User's Handle *=New³Bd³Activities³SignOn³SignOff³AG³Com³CaT³UpL³Posº "
  198.     top.6=' ÌÍÍÏÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÏÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÏÍÍÍÍÍÍÍÏÍÍÏÍÍÍÏÍÍÍÏÍÍÍÏÍÍ͹ '
  199.     bot.1=' ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ '
  200.     bot.2='  P#=Port Bd=Baud AG=AccessGroup Com=Computer CaT=Calls UpL=Uploads Pos=Posts  '
  201.     bot.3='   ActivitiesP:ost R:esponse U:pload D:ownload G:ame T:ext F:eedback M:ail   '
  202.     bot.4='      Caller Log, v3.2 Written by: Dotoran of Frontiers BBS(716)/823-9892      '
  203.     getuser 12 ; start='Call Log Started On: '||left(result,15)
  204.     mid.1='z4 z0cfº                    cb'||start||'                   cfºz4 z0'
  205.   return
  206.  
  207. DATA1:
  208.     act=0 ; ct=0 ; logged=0 ; sysopcalls=0
  209.     if V9=1 then top.1='f1@4CÚÄ¿ÚÄ¿Ú  Ú  ÚÄ¿Ú¿    Ú  ÚÄ¿ÚÄ¿'
  210.     if V9=0 then top.1='f1a1@4CÚÄ¿ÚÄ¿Ú  Ú  ÚÄ¿Ú¿    Ú  ÚÄ¿ÚÄ¿'
  211.     top.2=' ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»³  ÃÄ´³  ³  Ã¿ ÃÁ¿   ³  ³ ³³Ú¿ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»'
  212.     top.3=' ºCall Frontiers BBS!ºÀÄÙÀ ÙÀÄÙÀÄÙÀÄÙÀ À3.2ÀÄÙÀÄÙÀÄÙº (716)/823-9892 (14400) º'
  213.     top.4=' ÌÍÍÑÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÑÍÍÑÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÑÍÊÍÍÍÍÍÑÍÍÑÍÍÍÑÍÍÍÑÍÍÍÑÍÍ͹'
  214.     top.5=" ºP#³ID#³*User's Handle *=New³Bd³Activities³SignOn³SignOff³AG³Com³CaT³UpL³Posº"
  215.     top.6=' ÌÍÍÏÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÏÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÏÍÍÍÍÍÍÍÏÍÍÏÍÍÍÏÍÍÍÏÍÍÍÏÍÍ͹'
  216.     bot.1=' ÌÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍ͹'
  217.     bot.2=' ºP#=Port³Bd=Baud³AG=AccessGroup³Com=Computer³CaT=Calls³UpL=Uploads³Pos=Postsº'
  218.     bot.3=' È»Activities:³P:ost³R:esponse³U:pload³D:ownload³G:ame³T:ext³F:eedback³M:ailɼ'
  219.     bot.4='  ÈÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÏÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÏÍÍÍÍͼ'
  220.     getuser 12 ; start='Call Log Started On: '||left(result,15) ; l=left(V12,1)
  221.     mid.1=' c8º                    c'||l||start||'                   c8º'
  222.   return
  223.  
  224. SYNTAX:;ERROR:;IOERR:;er=rc' c7<ce'errortext(rc)'c7> c6in line ca'sigl
  225.     gu 1311992;a=result;gu 1311960;b=result;c='cb"cd'a||b'cb"';er='c9Error c6Code ca'er' c6of 'c'n2cf'
  226.     er=er||sigl'ce: cb'sourceline(sigl);tr er;logentry er;bufferflush
  227. /** Last Edited: 19-Jun-94 ************************************************\
  228. \****************************************** FRONTIERS BBS (716)/823-9892 **/
  229.